package com.caption.mq.handler;

import com.caption.mq.entity.MessageDTO;
import lombok.extern.slf4j.Slf4j;

/**
 * @description: TODO
 * @author: 码农
 * @date: 2022-01-11 11:02:34
 */
@Slf4j
public abstract class MessageHandler {

    public abstract void onMessage(MessageDTO messageDTO);

    public void onMessageHandleFailed(MessageDTO messageDTO, Exception e) {
        log.info("消费失败messageDTO:{}", messageDTO);
        log.error("消费失败", e);
    }
}
